package com.testmall.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
  * @Description: 
  * @Author: littleDesire
  * @Date: 2022-06-21 14:29
  * @Version: 1.0
  * 
  */
@ApiModel(value="com-testmall-entity-Orders")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "orders")
public class Orders implements Serializable {
    /**
     * 订单id
     */
    @TableId(value = "orderid", type = IdType.INPUT)
    @ApiModelProperty(value="订单id")
    private String orderid;

    /**
     * 用户id
     */
    @TableField(value = "userid")
    @ApiModelProperty(value="用户id")
    private String userid;

    @TableField(value = "shoppingid")
    @ApiModelProperty(value="")
    private String shoppingid;

    /**
     * 实际付款金额,单位是元,保留两位小数
     */
    @TableField(value = "payment")
    @ApiModelProperty(value="实际付款金额,单位是元,保留两位小数")
    private BigDecimal payment;

    /**
     * 支付类型,1-在线支付
     */
    @TableField(value = "paymenttype")
    @ApiModelProperty(value="支付类型,1-在线支付")
    private Integer paymenttype;

    /**
     * 运费,单位是元
     */
    @TableField(value = "postage")
    @ApiModelProperty(value="运费,单位是元")
    private Integer postage;

    /**
     * 订单状态:0-已取消-10-未付款，20-已付款，40-已发货，50-交易成功，60-交易关闭
     */
    @TableField(value = "status")
    @ApiModelProperty(value="订单状态:0-已取消-10-未付款，20-已付款，40-已发货，50-交易成功，60-交易关闭")
    private Integer status;

    /**
     * 支付时间
     */
    @TableField(value = "paymenttime")
    @ApiModelProperty(value="支付时间")
    private Date paymenttime;

    /**
     * 发货时间
     */
    @TableField(value = "sendtime")
    @ApiModelProperty(value="发货时间")
    private Date sendtime;

    /**
     * 交易完成时间
     */
    @TableField(value = "endtime")
    @ApiModelProperty(value="交易完成时间")
    private Date endtime;

    /**
     * 交易关闭时间
     */
    @TableField(value = "closetime")
    @ApiModelProperty(value="交易关闭时间")
    private Date closetime;

    /**
     * 创建时间
     */
    @TableField(value = "createtime")
    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "%Y-%m-%d %H:%i:%s")
    private String createtime;

    /**
     * 更新时间
     */
    @TableField(value = "updatetime")
    @ApiModelProperty(value = "更新时间")
    private Date updatetime;

    /**
     * 详情表
     */
    @ApiModelProperty(value = "订单详情")
    transient List<Orderitem> detail;

    private static final long serialVersionUID = 1L;

    public static final String COL_ORDERID = "orderid";

    public static final String COL_USERID = "userid";

    public static final String COL_SHOPPINGID = "shoppingid";

    public static final String COL_PAYMENT = "payment";

    public static final String COL_PAYMENTTYPE = "paymenttype";

    public static final String COL_POSTAGE = "postage";

    public static final String COL_STATUS = "status";

    public static final String COL_PAYMENTTIME = "paymenttime";

    public static final String COL_SENDTIME = "sendtime";

    public static final String COL_ENDTIME = "endtime";

    public static final String COL_CLOSETIME = "closetime";

    public static final String COL_CREATETIME = "createtime";

    public static final String COL_UPDATETIME = "updatetime";


    public String getOrderid() {
        return orderid;
    }

    public void setOrderid(String orderid) {
        this.orderid = orderid;
    }
}